package datagraph.bundle

import datagraph.core.{Bundle}
import upickle.default._

object Read{
  implicit val rw:ReadWriter[Read] = macroRW
}
case class Read(test: String, test2: Int = 1) extends Bundle.OnlyOutput[String] {
  override def apply: String = s"test:($test) test2:$test2"

  /*
  face
   */
  def this(test: Int) = {
    this("")
  }
}


object PrintAndOutput{
  implicit val rw:ReadWriter[PrintAndOutput] = macroRW
}
case class PrintAndOutput(name:String="t1") extends Bundle.InAndOut[String, String] {
  override def apply(in:String) = {
    println(s"index:$name print $in")
    (name+"-"+in)
  }
}





case class PrintName(name:String="p1") extends Bundle.JustRun{
  def apply=println(s"name=$name")
}